fix(tui): clear answer editing state when selecting other options - #44240
fix(tui): clear answer editing state when selecting other options#44240aniruddhaadak80 wants to merge 2 commits into
Conversation
Correct root-cause analysis: mouse paths call Details:
|
Review follow-up for anomalyco#44240: selectTab previously reset editing state even when the clicked tab was already active, so re-clicking the current tab header closed a custom-answer editor mid-typing. Navigation keybindings are disabled while editing, so mouse clicks were the only path that could hit this. Same-tab selection is now a no-op. Also documents the ordering invariant in selectOption: the custom-answer branch opens the editor and must return before any unconditional editing reset.
ca4afc5 to
1d70070
Compare
|
Thanks for the review - addressed in 1d70070:
|
Issue for this PR
Closes #44192
Type of change
What does this PR do?
Mouse handlers call
selectOption()/selectTab()directly and bypass theenabled: !store.editinggate on the keybindings. So after selecting "Type your own answer" (editing mode), clicking a preset option (or another question tab) picks it but leavesstore.editingstuck ontrue. At the confirm tab both binding sets then refuse Return - the editing set requires!confirm()and the normal set requires!store.editing- so the answers can never be submitted.This clears
editingwhen a preset option is picked or the tab changes. Selecting the custom row still enters edit mode as before; keyboard-only flows are unchanged since those keys are already gated off while editing.How did you verify your code works?
bun run typecheckclean inpackages/tui; existing tui test suite shows no new failures.Screenshots / recordings
Not a visual UI change.
Checklist